import Main from '@/views/Main.vue';

// 不作为Main组件的子页面展示的页面单独写，如下
export const loginRouter = {
    path: '/login',
    name: 'login',
    meta: {
        title: '登录'
    },
    component: () => import('@/views/login.vue')
};

export const page404 = {
    path: '/*',
    name: 'error-404',
    meta: {
        title: '404-页面不存在'
    },
    component: () => import('@/views/error-page/404.vue')
};

export const page403 = {
    path: '/403',
    meta: {
        title: '403-权限不足'
    },
    name: 'error-403',
    component: () => import('@//views/error-page/403.vue')
};

export const page500 = {
    path: '/500',
    meta: {
        title: '500-服务端错误'
    },
    name: 'error-500',
    component: () => import('@/views/error-page/500.vue')
};

export const preview = {
    path: '/preview',
    name: 'preview',
    component: () => import('@/views/form/article-publish/preview.vue')
};

export const locking = {
    path: '/locking',
    name: 'locking',
    component: () => import('@/views/main-components/lockscreen/components/locking-page.vue')
};

// 作为Main组件的子页面展示但是不在左侧菜单显示的路由写在otherRouter里
export const otherRouter = {
    path: '/',
    name: 'otherRouter',
    redirect: '/home',
    component: Main,
    children: [
        { path: 'home', title: {i18n: 'home'}, name: 'home_index', component: () => import('@/views/home/home.vue') },
        { path: 'ownspace', title: '个人中心', name: 'ownspace_index', component: () => import('@/views/own-space/own-space.vue') },
        { path: 'order/:order_id', title: '订单详情', name: 'order-info', component: () => import('@/views/advanced-router/component/order-info.vue') }, // 用于展示动态路由
        { path: 'shopping', title: '购物详情', name: 'shopping', component: () => import('@/views/advanced-router/component/shopping-info.vue') }, // 用于展示带参路由
        { path: 'message', title: '消息中心', name: 'message_index', component: () => import('@/views/message/message.vue') },
        { path: 'paperit', title: '试卷', name: 'paperit', component: () => import('@/views/self/papermanager/paper-it.vue') }
    ]
};

// 作为Main组件的子页面展示并且在左侧菜单显示的路由写在appRouter里
export const appRouter = [
  // 人员管理
  {
      path: '/roles-manager',
      icon: 'person',
      title: '人员管理',
      name: 'rolesmanager',
      access: 0,
      component: Main,
      children: [
          { path: 'index', title: '人员管理', name: 'roles-manager', access: 0, component: () => import('@/views/self/rolesmanager/roles-manager.vue') }
      ]
  },
    // 题库管理
    {
        path: '/subject-matter',
        icon: 'pricetags',
        title: '题库管理',
        name: 'subjectmatter',
        access: 0,
        component: Main,
        children: [
            { path: 'index', title: '题库管理', name: 'subject-matter', access: 0, component: () => import('@/views/self/subject/subject-matter.vue') }
        ]
    },
    // 模拟题模板参数
    {
        path: '/simu-params',
        icon: 'bookmark',
        title: '模拟题模板参数',
        name: 'simuparams',
        access: 0,
        component: Main,
        children: [
            { path: 'index', title: '模拟题模板参数', name: 'simu-params', access: 0, component: () => import('@/views/simu/simu-params.vue') }
        ]
    },
    // 试卷管理
    {
        path: '/paper-manager',
        icon: 'ios-paper',
        title: '试卷管理',
        name: 'papermanager',
        access: 0,
        component: Main,
        children: [
            { path: 'index', title: '试卷管理', name: 'paper-manager', access: 0, component: () => import('@/views/self/papermanager/paper-manager.vue') }
        ]
    },
    // 在线考试详情
    {
        path: '/online-situation',
        icon: 'ios-pulse-strong',
        title: '在线考试详情',
        name: 'onlinesituation',
        access: 0,
        component: Main,
        children: [
            { path: 'index', title: '在线考试详情', name: 'online-situation', access: 0, component: () => import('@/views/self/onlinesituation/online-situation.vue') }
        ]
    },
    // 成绩查询
    {
        path: '/result-inquiry',
        icon: 'ios-list',
        title: '成绩查询',
        name: 'resultinquiry',
        access: 0,
        component: Main,
        children: [
            { path: 'index', title: '成绩查询', name: 'result-inquiry', access: 0, component: () => import('@/views/self/resultinquiry/result-inquiry.vue') }
        ]
    },
    // 题库分类参数
    {
        path: '/classparams',
        icon: 'ios-pricetags',
        title: '参数管理',
        name: 'classparams',
        access: 0,
        component: Main,
        children: [
            { path: 'index', title: '参数管理', name: 'class-params', access: 0, component: () => import('@/views/self/classparams/class-params.vue') }
        ]
    },
    // 错题率统计
    {
        path: '/error-statis',
        icon: 'arrow-graph-up-right',
        title: '错题统计',
        name: 'errorstatis',
        access: 0,
        component: Main,
        children: [
            { path: 'index', title: '错题统计', name: 'error-statis', access: 0, component: () => import('@/views/self/errorstatis/error-statis.vue') }
        ]
    },
    {
        path: '/changeps',
        icon: 'person',
        title: '修改密码',
        name: 'changeps',
        access: 0,
        component: Main,
        children: [
            { path: 'index', title: '修改密码', name: 'changeps', access: 0, component: () => import('@/views/self/changeps/changeps.vue') }
        ]
    },
    // 综合统计报表
    // {
    //     path: '/reportself',
    //     icon: 'ios-book',
    //     title: '综合统计报表',
    //     name: 'reportself',
    //     access: 0,
    //     component: Main,
    //     children: [
    //         { path: 'index', title: '综合统计报表', name: 'report', access: 0, component: () => import('@/views/self/report/report.vue') }
    //     ]
    // },
    // ivew-admin
    // {
    //     path: '/access',
    //     icon: 'key',
    //     name: 'access',
    //     title: '权限管理',
    //     component: Main,
    //     children: [
    //         { path: 'index', title: '权限管理', name: 'access_index', component: () => import('@/views/access/access.vue') }
    //     ]
    // },
    // {
    //     path: '/access-test',
    //     icon: 'lock-combination',
    //     title: '权限测试页',
    //     name: 'accesstest',
    //     access: 0,
    //     component: Main,
    //     children: [
    //         { path: 'index', title: '权限测试页', name: 'accesstest_index', access: 0, component: () => import('@/views/access/access-test.vue') }
    //     ]
    // },
    // {
    //     path: '/international',
    //     icon: 'earth',
    //     title: {i18n: 'international'},
    //     name: 'international',
    //     component: Main,
    //     children: [
    //         { path: 'index', title: {i18n: 'international'}, name: 'international_index', component: () => import('@/views/international/international.vue') }
    //     ]
    // },
    // {
    //     path: '/component',
    //     icon: 'social-buffer',
    //     name: 'component',
    //     title: '组件',
    //     component: Main,
    //     children: [
    //         {
    //             path: 'text-editor',
    //             icon: 'compose',
    //             name: 'text-editor',
    //             title: '富文本编辑器',
    //             component: () => import('@/views/my-components/text-editor/text-editor.vue')
    //         },
    //         {
    //             path: 'md-editor',
    //             icon: 'pound',
    //             name: 'md-editor',
    //             title: 'Markdown编辑器',
    //             component: () => import('@/views/my-components/markdown-editor/markdown-editor.vue')
    //         },
    //         {
    //             path: 'image-editor',
    //             icon: 'crop',
    //             name: 'image-editor',
    //             title: '图片预览编辑',
    //             component: () => import('@/views/my-components/image-editor/image-editor.vue')
    //         },
    //         {
    //             path: 'draggable-list',
    //             icon: 'arrow-move',
    //             name: 'draggable-list',
    //             title: '可拖拽列表',
    //             component: () => import('@/views/my-components/draggable-list/draggable-list.vue')
    //         },
    //         {
    //             path: 'area-linkage',
    //             icon: 'ios-more',
    //             name: 'area-linkage',
    //             title: '城市级联',
    //             component: () => import('@/views/my-components/area-linkage/area-linkage.vue')
    //         },
    //         {
    //             path: 'file-upload',
    //             icon: 'android-upload',
    //             name: 'file-upload',
    //             title: '文件上传',
    //             component: () => import('@/views/my-components/file-upload/file-upload.vue')
    //         },
    //         {
    //             path: 'count-to',
    //             icon: 'arrow-graph-up-right',
    //             name: 'count-to',
    //             title: '数字渐变',
    //             // component: () => import('@/views/my-components/count-to/count-to.vue')
    //             component: () => import('@/views/my-components/count-to/count-to.vue')
    //         },
    //         {
    //             path: 'split-pane-page',
    //             icon: 'ios-pause',
    //             name: 'split-pane-page',
    //             title: 'split-pane',
    //             component: () => import('@/views/my-components/split-pane/split-pane-page.vue')
    //         }
    //     ]
    // },
    // {
    //     path: '/form',
    //     icon: 'android-checkbox',
    //     name: 'form',
    //     title: '表单编辑',
    //     component: Main,
    //     children: [
    //         { path: 'artical-publish', title: '文章发布', name: 'artical-publish', icon: 'compose', component: () => import('@/views/form/article-publish/article-publish.vue') },
    //         { path: 'workflow', title: '工作流', name: 'workflow', icon: 'arrow-swap', component: () => import('@/views/form/work-flow/work-flow.vue') }
    //
    //     ]
    // },
    // // {
    // //     path: '/charts',
    // //     icon: 'ios-analytics',
    // //     name: 'charts',
    // //     title: '图表',
    // //     component: Main,
    // //     children: [
    // //         { path: 'pie', title: '饼状图', name: 'pie', icon: 'ios-pie', component: resolve => { require('@/views/access/access.vue') },
    // //         { path: 'histogram', title: '柱状图', name: 'histogram', icon: 'stats-bars', component: resolve => { require('@/views/access/access.vue') }
    //
    // //     ]
    // // },
    // {
    //     path: '/tables',
    //     icon: 'ios-grid-view',
    //     name: 'tables',
    //     title: '表格',
    //     component: Main,
    //     children: [
    //         { path: 'dragableTable', title: '可拖拽排序', name: 'dragable-table', icon: 'arrow-move', component: () => import('@/views/tables/dragable-table.vue') },
    //         { path: 'editableTable', title: '可编辑表格', name: 'editable-table', icon: 'edit', component: () => import('@/views/tables/editable-table.vue') },
    //         { path: 'searchableTable', title: '可搜索表格', name: 'searchable-table', icon: 'search', component: () => import('@/views/tables/searchable-table.vue') },
    //         { path: 'exportableTable', title: '表格导出数据', name: 'exportable-table', icon: 'code-download', component: () => import('@/views/tables/exportable-table.vue') },
    //         { path: 'table2image', title: '表格转图片', name: 'table-to-image', icon: 'images', component: () => import('@/views/tables/table-to-image.vue') }
    //     ]
    // },
    // {
    //     path: '/advanced-router',
    //     icon: 'ios-infinite',
    //     name: 'advanced-router',
    //     title: '高级路由',
    //     component: Main,
    //     children: [
    //         { path: 'mutative-router', title: '动态路由', name: 'mutative-router', icon: 'link', component: () => import('@/views/advanced-router/mutative-router.vue') },
    //         { path: 'argument-page', title: '带参页面', name: 'argument-page', icon: 'android-send', component: () => import('@/views/advanced-router/argument-page.vue') }
    //     ]
    // },
    // {
    //     path: '/error-page',
    //     icon: 'android-sad',
    //     title: '错误页面',
    //     name: 'errorpage',
    //     component: Main,
    //     children: [
    //         { path: 'index', title: '错误页面', name: 'errorpage_index', component: () => import('@/views/error-page/error-page.vue') }
    //     ]
    // },

];
// 考生个人中心
export const examperson = {
    path: '/exam-person',
    name: 'examperson',
    meta: {
      title: '考生个人中心'
    },
    component: () => import('@/views/exam/exam-person.vue')
}
// 考试须知
export const exam = {
    path: '/exam-notice',
    name: 'notice',
    meta: {
      title: '考试须知'
    },
    component: () => import('@/views/exam/exam-notice.vue')
}
// 答题页面(旧)
export const answer = {
    path: '/answer',
    name: 'answer',
    meta: {
      title: '答题中'
    },
    component: () => import('@/views/exam/answer.vue')
}
// 答题页面(新)
export const paperanswer = {
    path: '/paper-answer',
    name: 'paper-answer',
    meta: {
      title: '答题中'
    },
    component: () => import('@/views/exam/paper-answer.vue')
}
// 得分情况
export const score = {
    path: '/exam-score',
    name: 'score',
    meta: {
      title: '考试结束'
    },
    component: () => import('@/views/exam/exam-score.vue')
}
// 得分情况
export const priview = {
    path: '/paper-preview',
    name: 'priview',
    meta: {
      title: '试卷浏览'
    },
    component: () => import('@/views/preview/paper-preview.vue')
}
// 所有上面定义的路由都要写在下面的routers里
export const routers = [
    loginRouter,
    otherRouter,
    preview,
    locking,
    examperson,
    exam,
    answer,
    paperanswer,
    score,
    priview,
    ...appRouter,
    page500,
    page403,
    page404

];
